package cn.itcast.bos.Dao.system;

import cn.itcast.bos.domain.system.Permission;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

public interface PermissionRepository extends JpaRepository<Permission,Integer> {
    @Query("select p from Permission p inner join fetch p.roles r inner join fetch r.users u where u.id=?1")
    @Modifying
    List<Permission> finByUser(Integer id );
}
